home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 30
/
030.d81
/
pick-up blocks
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
133 lines
0 gosub60100:clr:bk$="[164]"
5 dim n(3),h(18),l(18),d(18):forn=0to16:readh(n),l(n),d(n):next
10 poke53280,6:poke53281,3:a=54272:pokea+24,15
15 n(1)=3:n(2)=5:n(3)=7:gosub300
20 print"[212]he object of this game is to force":print
25 print"me to take the last remaining":print
30 print"block. [207]n a given turn you may take":print
35 print"as many blocks from one row [146] as you ":print
40 print"wish, but you must take at least one.":print
45 print"[195]an you figure out the trick?":print
50 print"[215]hen you're ready, press any key.":fora=1to1000:next:poke198,0
55 geta$:ifa$=""then55
60 n(1)=3:n(2)=5:n(3)=7:gosub300
65 gosub300:print"[217]our move. [215]hich row? [157]";:gosub60500:printa$:i=val(a$)
66 ifi>3ori<1then65
70 print"[212]ake how many? [157]";:gosub60500:printa$:j=val(a$):ifj>n(i)then65
75 ifj<1then65
76 print"[193]re you sure ([217]/[206])"
80 gosub60500:an$=a$
81 ifan$="n"oran$="[206]"then65
82 ifan$<>"y"andan$<>"[217]"then80
85 n(i)=n(i)-j
90 if(n(1)<>0)or(n(2)<>0)or(n(3)<>0)then115
95 print"[147] [193][200][193]! [199]otcha!"
100 gosub 350
105 print" [208]lay [193]gain? ([217]/[206])"
106 gosub60500:an$=a$:ifan$="y"oran$="[217]"then60
107 ifan$<>"n"andan$<>"[206]"then106
110 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
111 print"[147]";:ifer<>63thenend
112 load"hello connect",8
115 gosub300:print"[205]y move ...":l=0:s=7:m=o:h=0
120 fori=1to3:ifn(i)<sthens=n(i):l=i
125 next
130 fori=1to3:ifn(i)>sthens=n(i):h=i
135 next:ifh=0thenh=3:m=2:goto155
140 t=n(1)+n(2)+n(3)-n(l)-n(h)
145 fori=1to3:if(n(i)=t)and(i<>h)and(i<>l)thenm=i
150 next
155 ifn(l)=1then185
160 ifn(l)=0then210
165 ifn(m)=n(h)thenn(l)=0:goto230
170 ifn(l)=n(m)thenn(h)=0:goto255
175 if(n(l)=2)and(n(m)=3)thenn(h)=1:goto230
180 n(l)=n(l)-1:goto230
185 if(n(m)=1)and(n(h)>1)thenn(h)=1:goto230
190 ifn(m)=n(h)thenn(l)=0:goto230
195 if(n(m)=2)and(n(h)>3)thenn(h)=3:goto230
200 if(n(m)=3)and(n(h)>=3)thenn(h)=2:goto230
205 n(m)=n(m)-1:goto230
210 if(n(m)=0)and(n(h)>1)thenn(h)=1:goto230
215 ifn(m)=1thenn(h)=0:goto255
220 ifn(m)<>n(h)thenn(h)=n(m):goto230
225 n(m)=n(m)-1:goto230
230 forj=1to1000:next
235 ifn(h)<>0then255
240 print"[147][215]ell, you did it!"
245 print"[217]ou beat me fair and square!"
250 gosub400:goto105
255 forj=1to1000:next:goto65
300 print"[144][147] [208]ick-[213]p [194]locks"
301 print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
305 fori=1to3:printi".";
310 ifn(i)=0then325
315 fork=1ton(i)
320 print" [146]";:next
325 print
330 print:next:print:print
335 return
350 pokea+5,9:pokea+6,0
355 forn=6to16:pokea,l(n):pokea+1,h(n):pokea+4,17
360 fort=1tod(n):nextt
365 pokea+4,16:fort=1to10:next:next
370 return
400 pokea+5,9:pokea+6,0
405 forn=0to5:pokea,l(n):pokea+1,h(n):pokea+4,33
410 fort=1tod(n):nextt
415 pokea+4,32:fort=1to10:next:next
420 return
450 data 16,195,64,21,31,64,25,30,64
455 data 33,135,128,25,30,64,33,135,128
460 data 16,195,256,16,195,192,16,195,64
465 data 16,195,256,19,239,192,18,209,64
470 data 18,209,128,16,195,128,16,195,128
475 data 15,210,128,16,195,256
60100 pn$="[208][201][195][203]-[213][208] [194][204][207][195][203][211]":an$="[194][217]: [210][207][199][197][210] [211]. [205][193][195][207][205][194][197][210]"
60110 bo=06:sc=00:cl=15:c1=06:c2=03:c3=06:c4=03:c5=08:c6=07:c7=08
60120 rem bo - border color
60121 rem sc - screen color
60122 rem cl - color on border
60123 rem c1 - top box outside color
60124 rem c2 - top box inside color
60125 rem c3 - bottom box outside color
60126 rem c4 - bottom box inside color
60127 rem c5 - 'copyright' color
60128 rem c6 - 'program name' color
60129 rem c7 - 'authors name' color
60130 poke53280,bo:poke53281,sc:print"[147]";:goto60250
60140 poke646,c1:print" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
60150 poke646,c2:print" [165] [204][207][193][196][211][212][193][210] [208][210][197][211][197][206][212][211]: [167]"
60170 poke646,c1:print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
60180 poke646,c6:print""tab(20-len(pn$)/2);pn$
60190 poke646,c7:print""tab(20-len(an$)/2);an$
60200 poke646,c5:print""tab(13)"[195][207][208][217][210][201][199][200][212] 1986"
60210 printtab(9)"[195][207][205][205][207][196][207][210][197] [208][213][194][204][201][195][193][212][201][207][206][211]"
60220 poke646,c3:print" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
60230 poke646,c4:print" [165] [167]"
60240 poke646,c3:print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][146]";
60245 poke198,.:goto60360
60250 poke646,cl
60255 print" [172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
60260 fora=1to3:gosub60470:next
60270 gosub60470:print"[145][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
60280 fora=1to16:gosub60470:next
60290 print"[145][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175]"
60300 fora=1to3:gosub60470:next
60310 print" [188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]";
60320 poke53280,bo:poke53281,sc:goto60140
60360 print"";
60370 poke646,c2:print"[165][208]ress the [[211][208][193][195][197] [194][193][210]] to continue.[167]"
60380 fora=1to100
60390 geta$:ifa$=" "ora$="[160]"thenreturn
60400 next
60410 print"";
60420 print"[165] [167]"
60430 fora=1to100
60440 geta$:ifa$=" "ora$="[160]"thenreturn
60450 next
60460 goto60360
60470 print" [161][146][161]":return
60500 geta$:ifa$=""then60500
60510 return